<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>分类管理</title>
    <link rel="stylesheet" type="text/css" href="http://localhost/e-shop/xiangqu/Static/hdjs/hdjs.css"/>
    <script src="http://localhost/e-shop/xiangqu/Static/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="http://localhost/e-shop/xiangqu/Static/hdjs/hdjs.min.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" href="http://localhost/e-shop/xiangqu/Static/bootstrap/bootstrap.min.css" />
    <style type="text/css">
        .plus_minus{
            width: 20px;
        }
       .wrap .hd-btn{
        	margin: 0px;
        }
        a:hover{
        	text-decoration: none;
        }
        .glyphicon{
        	font:700 22px/25px "微软雅黑";
        }
        .wrap table tr td{
        	border:1px solid #E0DEDE;
        	text-align: center;
        }
        .wrap table thead tr{
        	text-align: center;
        }
    </style>

</head>
<body>
<div class="wrap">
    <table class="table2 hd-table hd-table-list" border="1" style="border:1px solid #E0DEDE">
        <thead>
        <tr>
            <td width="100">商品id</td>
            <td width="400">商品名称</td>
            <td width="100">商城价格</td>
            <td width="100">市场价格</td>
            <td width="100">商品库存</td>
            <td width="200">添加时间</td>
            <td width="200">操作</td>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($data as $k=>$v){?>
		<tr>
            <td><?php echo $v['gid'];?></td>
            <td><?php echo $v['gname'];?></td>
            <td><?php echo $v['shopprice'];?></td>
            <td><?php echo $v['marketprice'];?></td>
            <td><?php echo $v['stock'];?></td>
            <td><?php echo date('y-m-d',$v['addtime']);?></td>
            <td width="200">
            	<a href="<?php echo U('Admin/GoodsList/index',array('gid'=>$v['gid']));?>" class="hd-btn hd-btn-success hd-btn-sm">货品列表</a>
            	<a href="<?php echo U('Admin/Goods/edit',array('gid'=>$v['gid']));?>" class="hd-btn hd-btn-primary hd-btn-sm">编辑</a>
            	<a href="javascript:hd_modal_del(<?php echo $v['gid'];?>)" class="hd-btn hd-btn-danger hd-btn-sm">删除</a>
            </td>
        </tr>
        <?php }?>
        </tbody>
    </table>
    <!--<div class="position-bottom">-->
    	<!--<?php $tid = Q('get.tid') ?>-->
    	<!--<a href="<?php echo U('Admin/TypeAttr/add',array('tid'=>$hd.get.tid));?>" class="hd-btn hd-btn-success"/>添加属性</a>
     </div>-->
    <div class="page_hdjob">
        
    </div>
</div>
<script type="text/javascript">
	function hd_modal_del(id) {
        hd_modal({
            width: 400,//宽度
            height: 150,//高度
            title: '确认删除吗？',//标题
            content: '',//提示信息
            button: true,//显示按钮
            button_success: "确定",//确定按钮文字
            button_cancel: "取消",//关闭按钮文字
            timeout: 0,//自动关闭时间 0：不自动关闭
            shade: true,//背景遮罩
            shadeOpacity: 0.4,//背景透明度
            success: function () {//点击确定后的事件
				location.href = "http://localhost/e-shop/xiangqu/index.php/Admin/Goods" + '/delete/gid/' + id;
            },
            cancel: function () {//点击关闭后的事件
				
            }
        });
    }
</script>
</body>
</html>


